package com.yzmoney.wechat.model.send;

/*
{
    "touser":"OPENID",
    "msgtype":"text",
    "text":
    {
         "content":"Hello World"
    }
}
*/

public class TextMsg {
	
	private String touser;
	
	private String msgtype;
	
	private Content text; 
	//企业号需要agentid作为标识符
	private String agentid;
	public TextMsg() {
		super();
		this.msgtype = "text";
	}

	public TextMsg(String touser, Content text) {
		super();
		this.touser = touser;
		this.text = text;
		this.msgtype = "text";
	}
	
	public TextMsg(String touser, String text,String agentid) {
		super();
		this.touser = touser;
		this.text = new Content(text);
		this.msgtype = "text";
		this.agentid=agentid;
	}

	public String getTouser() {
		return touser;
	}

	public void setTouser(String touser) {
		this.touser = touser;
	}

	public String getMsgtype() {
		return msgtype;
	}

	public void setMsgtype(String msgtype) {
		this.msgtype = msgtype;
	}

	public Content getText() {
		return text;
	}

	public void setText(Content text) {
		this.text = text;
	}
	
	public void setText(String text){
		this.text = new Content(text);
	}

	public String getAgentid() {
		return agentid;
	}

	public void setAgentid(String agentid) {
		this.agentid = agentid;
	}

	@Override
	public String toString() {
		return "TextMsg [touser=" + touser + ", msgtype=" + msgtype + ", text="
				+ text +", agentid="+agentid+ "]";
	}

	class Content{
		
		private String content;

		public Content() {
			super();
		}

		public Content(String content) {
			super();
			this.content = content;
		}

		public String getContent() {
			return content;
		}

		public void setContent(String content) {
			this.content = content;
		}

		@Override
		public String toString() {
			return "Content [content=" + content + "]";
		}
	}
}
